﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_SoNhatKyChung : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CboDonVi")]
        private ComboBox _CboDonVi;
        [AccessedThroughProperty("CmdCancel")]
        private Button _CmdCancel;
        [AccessedThroughProperty("CmdOK")]
        private Button _CmdOK;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("UpDown1")]
        private NumericUpDown _UpDown1;
        [AccessedThroughProperty("UpDown2")]
        private NumericUpDown _UpDown2;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private string pNamThang;

        [DebuggerNonUserCode]
        public Frm_SoNhatKyChung()
        {
            base.Load += new EventHandler(this.Frm_SoNhatKyChung_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.InitializeComponent();
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdOK_Click(object sender, EventArgs e)
        {
            this.pNamThang = this.UpDown2.Value.ToString() + LVYModule.sRight("00" + this.UpDown1.Value.ToString().Trim(), 2);
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            DataTable dataPrintNhatKyChung = this.GetDataPrintNhatKyChung(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboDonVi.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), this.pNamThang);
            if (dataPrintNhatKyChung.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_SoNhatKyChung chung = new Rpt_SoNhatKyChung();
                try
                {
                    chung.SetDataSource(dataPrintNhatKyChung);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        chung.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        chung.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    chung.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESS);
                    chung.SetParameterValue(2, modGeneral.Tranlated("M\x00e3 số thuế", "") + ": " + modGeneral.H_TAXCODE);
                    chung.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    chung.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    chung.SetParameterValue(5, modGeneral.Tranlated("SỔ NHẬT K\x00dd CHUNG", ""));
                    chung.SetParameterValue(6, modGeneral.Tranlated("Ng\x00e0y th\x00e1ng ghi", ""));
                    chung.SetParameterValue(7, modGeneral.Tranlated("Chứng từ", ""));
                    chung.SetParameterValue(8, modGeneral.Tranlated("Số hiệu", ""));
                    chung.SetParameterValue(9, modGeneral.Tranlated("Ng\x00e0y th\x00e1ng", ""));
                    chung.SetParameterValue(10, modGeneral.Tranlated("Diễn giải", ""));
                    chung.SetParameterValue(11, modGeneral.Tranlated("Đ\x00e3 ghi sổ c\x00e1i", ""));
                    chung.SetParameterValue(12, modGeneral.Tranlated("Số hiệu t\x00e0i khoản", ""));
                    chung.SetParameterValue(13, modGeneral.Tranlated("Số ph\x00e1t sinh", ""));
                    chung.SetParameterValue(14, modGeneral.Tranlated("C\x00f3", ""));
                    chung.SetParameterValue(15, modGeneral.Tranlated("Nợ", ""));
                    chung.SetParameterValue(0x10, modGeneral.Tranlated("Nợ", ""));
                    chung.SetParameterValue(0x11, modGeneral.Tranlated("Cộng chuyển sang trang", ""));
                    chung.SetParameterValue(0x12, modGeneral.Tranlated("Số trang trước chuyển qua", ""));
                    chung.SetParameterValue(0x13, modGeneral.Tranlated("Cộng ph\x00e1t sinh", ""));
                    chung.SetParameterValue(20, modGeneral.Tranlated("Người ghi sổ", ""));
                    chung.SetParameterValue(0x15, modGeneral.Tranlated("Kế to\x00e1n trưởng", ""));
                    chung.SetParameterValue(0x16, modGeneral.Tranlated("(K\x00fd, họ t\x00ean)", ""));
                    chung.SetParameterValue(0x17, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    chung.SetParameterValue(0x18, "(1)");
                    chung.SetParameterValue(0x19, "(2)");
                    chung.SetParameterValue(0x1a, "(3)");
                    chung.SetParameterValue(0x1b, "(4)");
                    chung.SetParameterValue(0x1c, "(5)");
                    chung.SetParameterValue(0x1d, "(6)");
                    chung.SetParameterValue(30, "(7)");
                    chung.SetParameterValue(0x1f, "(8)");
                    chung.SetParameterValue(0x20, "x");
                    chung.SetParameterValue(0x21, modGeneral.Tranlated("Th\x00e1ng :", "") + LVYModule.sRight("00" + this.UpDown1.Value.ToString().Trim(), 2) + "/" + this.UpDown2.Value.ToString());
                    chung.SetParameterValue(0x22, modGeneral.Tranlated("Gi\x00e1m đốc", ""));
                    chung.SetParameterValue(0x23, modGeneral.Tranlated("(K\x00fd, họ t\x00ean,đ\x00f3ng dấu)", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = chung;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    if (Form.ActiveForm != null)
                    {
                        Form.ActiveForm.Cursor = Cursors.Default;
                    }
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void Frm_SoNhatKyChung_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.UpDown1.Value = new decimal(DateAndTime.Month(DateAndTime.Today));
                this.UpDown2.Value = new decimal(DateAndTime.Year(DateAndTime.Today));
                BuildComboModule.BuildCombo(this.CboDonVi, modGeneral.ListDanhMuc.DonVi, false, "", "");
                this.CboDonVi.SelectedValue = modGeneral.H_CLIENT;
            }
        }

        public DataTable GetDataPrintNhatKyChung(string strKhoaDonVi, string strNamThang)
        {
            DataTable table;
            IDataParameter[] commandParameters = new IDataParameter[3];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, strKhoaDonVi);
                commandParameters[1] = DBHelper.createParameter("@NamThang", DbType.Int64, ParameterDirection.Input, strNamThang);
                commandParameters[2] = DBHelper.createParameter("@Language", DbType.Int64, ParameterDirection.Input, modGeneral.H_LANGUAGE);
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "BC_sp_BangKeNhatKyChung", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_SoNhatKyChung));
            this.GroupBox1 = new GroupBox();
            this.Label3 = new Label();
            this.CboDonVi = new ComboBox();
            this.UpDown1 = new NumericUpDown();
            this.UpDown2 = new NumericUpDown();
            this.Label2 = new Label();
            this.Label1 = new Label();
            this.CmdCancel = new Button();
            this.CmdOK = new Button();
            this.GroupBox1.SuspendLayout();
            this.UpDown1.BeginInit();
            this.UpDown2.BeginInit();
            this.SuspendLayout();
            this.GroupBox1.BackColor = Color.Transparent;
            this.GroupBox1.Controls.Add(this.Label3);
            this.GroupBox1.Controls.Add(this.CboDonVi);
            this.GroupBox1.Controls.Add(this.UpDown1);
            this.GroupBox1.Controls.Add(this.UpDown2);
            this.GroupBox1.Controls.Add(this.Label2);
            this.GroupBox1.Controls.Add(this.Label1);
            Point point = new Point(3, 2);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            Size size = new Size(0x13f, 120);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 0;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "T\x00f9y chọn";
            this.Label3.AutoSize = true;
            point = new Point(9, 0x22);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x26, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 15;
            this.Label3.Text = "Đơn vị";
            this.CboDonVi.FormattingEnabled = true;
            point = new Point(0x48, 0x1f);
            this.CboDonVi.Location = point;
            this.CboDonVi.Name = "CboDonVi";
            size = new Size(0xef, 0x15);
            this.CboDonVi.Size = size;
            this.CboDonVi.TabIndex = 14;
            point = new Point(0x48, 0x42);
            this.UpDown1.Location = point;
            decimal num = new decimal(new int[] { 12, 0, 0, 0 });
            this.UpDown1.Maximum = num;
            num = new decimal(new int[] { 1, 0, 0, 0 });
            this.UpDown1.Minimum = num;
            this.UpDown1.Name = "UpDown1";
            size = new Size(0x26, 20);
            this.UpDown1.Size = size;
            this.UpDown1.TabIndex = 13;
            num = new decimal(new int[] { 1, 0, 0, 0 });
            this.UpDown1.Value = num;
            point = new Point(0xc2, 0x42);
            this.UpDown2.Location = point;
            num = new decimal(new int[] { 0xbb8, 0, 0, 0 });
            this.UpDown2.Maximum = num;
            num = new decimal(new int[] { 0x7d0, 0, 0, 0 });
            this.UpDown2.Minimum = num;
            this.UpDown2.Name = "UpDown2";
            size = new Size(50, 20);
            this.UpDown2.Size = size;
            this.UpDown2.TabIndex = 12;
            num = new decimal(new int[] { 0x7d7, 0, 0, 0 });
            this.UpDown2.Value = num;
            this.Label2.AutoSize = true;
            point = new Point(0x92, 0x45);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x1d, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 1;
            this.Label2.Text = "Năm";
            this.Label1.AutoSize = true;
            point = new Point(9, 0x44);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x26, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0;
            this.Label1.Text = "Th\x00e1ng";
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = (Image) manager.GetObject("CmdCancel.Image");
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(240, 0x80);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x52, 0x19);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 0x3a;
            this.CmdCancel.Text = "&Tho\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.CmdOK.Image = (Image) manager.GetObject("CmdOK.Image");
            this.CmdOK.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x9d, 0x80);
            this.CmdOK.Location = point;
            this.CmdOK.Name = "CmdOK";
            size = new Size(0x51, 0x19);
            this.CmdOK.Size = size;
            this.CmdOK.TabIndex = 0x39;
            this.CmdOK.Text = "&Chọn";
            this.CmdOK.UseVisualStyleBackColor = true;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            size = new Size(0x146, 160);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.CmdCancel);
            this.Controls.Add(this.CmdOK);
            this.Controls.Add(this.GroupBox1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_SoNhatKyChung";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BC-0007             ";
            this.Text = "SO NHAT KY CHUNG";
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            this.UpDown1.EndInit();
            this.UpDown2.EndInit();
            this.ResumeLayout(false);
        }

        internal virtual ComboBox CboDonVi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboDonVi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboDonVi = value;
            }
        }

        internal virtual Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCancel_Click);
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click -= handler;
                }
                this._CmdCancel = value;
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click += handler;
                }
            }
        }

        internal virtual Button CmdOK
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdOK;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdOK_Click);
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click -= handler;
                }
                this._CmdOK = value;
                if (this._CmdOK != null)
                {
                    this._CmdOK.Click += handler;
                }
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual NumericUpDown UpDown1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._UpDown1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._UpDown1 = value;
            }
        }

        internal virtual NumericUpDown UpDown2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._UpDown2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._UpDown2 = value;
            }
        }
    }
}

